<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <title>创客签到系统</title>
    <link rel="stylesheet" href="/static/style/css/bootstrap.css">
    <link rel="stylesheet" href="/static/style/css/font-awesome.css">
    <script src="/static/style/js/jquery.js"></script>
    <script src="/static/style/js/bootstrap.js"></script>
    <link rel="stylesheet" href="/static/style/css/header.css">
    <link rel="stylesheet" href="/static/style/css/all-style.css">
    <script type="text/javascript" src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script>
    <script src="/static/style/js/location.js"></script>

    <script src="/static/style/js/encode-qrcode.js"></script>
    <script src="/static/style/js/qrscan.js"></script>
    <style>
        .dropdown-menu > li > a {
            padding: 6px 20px;
        }
    </style>
    <script>
        if (navigator.userAgent.search("(MQQBrowser|Edge|Quark|QQ|Mac|Win)") === -1) {
            location.href = '/no';
        }
    </script>
</head>
<body class="skin-blue">
    <header>
        <a class="logo">创客签到系统</a>
        <div class="header-nav">
            {% if stu %}
                <span class="label label-xs label-info">欢迎: <strong>{{ username }}</strong></span>
            {% endif %}
            <div class="dropdown pull-right">
                <button class="btn btn-xs btn-warning dropdown-toggle" data-toggle="dropdown">
                    <span class="fa fa-gear"></span>菜单
                </button>
                <ul class="dropdown-menu dropdown-menu-right">
                    {% if not stu %}
                        <li><a href="/login"><span class="fa fa-user"></span>&nbsp;&nbsp;登录</a></li>
                    {% else %}
                        <li><a href="/change"><span class="fa fa-eyedropper"></span>&nbsp;修改信息</a></li>
                        <li><a href="/change_mm"><span class="fa fa-unlock-alt"></span>&nbsp; 修改密码</a></li>
                        <li class="logout"><a href="javascript:"><span class="fa fa-sign-out"></span>&nbsp;注销</a></li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </header>

    <nav class="body-nav">
        <div class="btns">
            {% if stu %}
                <a href="/home" class="btn btn-primary">主页 <span class="fa fa-home"></span></a>
                <a href="/class" class="btn btn-warning">课程 <span class="fa fa-book"></span></a>
                <a href="/record" class="btn btn-success">记录 <span class="fa fa-file-text"></span></a>
                <a href="/check" class="btn btn-danger">考勤 <span class="fa fa-camera"></span></a>
            {% else %}
                <a href="/login" class="btn btn-primary">登录 <span class="fa fa-sign-in"></span></a>
                <a href="/register" class="btn btn-warning">注册 <span class="fa fa-plus-circle"></span></a>
                <a href="/about" class="btn btn-success">关于 <span class="fa fa-info-circle"></span></a>
            {% endif %}
        </div>
    </nav>

    <script>
        $('.logout').click(function (e) {
            $.post('/logout', function (data) {
                if (data.status){
{#                    alert('SUCCESS: 注销成功');#}
                    location.reload();
                }
            });
        });
    </script>